package view.General;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import view.Windows.InsertDBInfoGUI;
import view.Windows.LoginGUI;

public final class LegenDateGUI implements Runnable {

	protected Boolean isLogin = false;
	private final static LegenDateGUI INSTANCE = new LegenDateGUI();

	public static LegenDateGUI get() {
		return INSTANCE;
	}

	public LegenDateGUI() {
	}

	// run the GUI
	public void run() {
		final Display dspMain = new Display();
		Shell shlMain = new Shell(dspMain, SWT.SHELL_TRIM & ~SWT.RESIZE & ~SWT.MAX);
		new InsertDBInfoGUI(dspMain).showGUI(dspMain);
		if (getIsLogin()) {
			LoginGUI.get().LoginGUIRun(dspMain, shlMain);
		} else
			System.exit(0);
	}

	public Boolean getIsLogin() {
		return isLogin;
	}

	public void setIsLogin(Boolean isLogin) {
		this.isLogin = isLogin;
	}
}
